POV-Ray : Newsgroups : povray.general : semi-colon in macro ? : semi-colon in macro ? Server Time
11 Aug 2024 09:25:38 EDT (-0400)
  semi-colon in macro ?  
From: ingo
Date: 16 Aug 1999 13:10:23
Message: <37b845ff@news.povray.org>
Three little macro's. The first and third are ok, the second is not. The only
difference between Twee and Drie is the position of the semi-colons. I
understand that a macro works by text replacement. That does not make me
understand why Twee doesn't work and Drie does. Can somebody explain?

#macro Een(A,B,C)
   A+B+C
#end //macro
#declare Som1=Een(1,2,3);
sphere {Som1,1}


#macro Twee(A,B,C)
   #local P=A+B+C;
   #if (P=0)
      A+B-C
   #else
      A+B+C
   #end
#end
#declare Som2=Twee(1,2,3);
sphere {Som2,1}


#macro Drie(A,B,C)
   #local P=A+B+C;
   #if (P=0)
      A+B-C;
   #else
      A+B+C;
   #end
#end
#declare Som3=Drie(1,2,3)
sphere {Som3,1}


ingo
--
Met dank aan de muze met het glazen oog.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.